/*f0JfMjUngRu2xmNXuho8gqv/3wzMBrzZNLt+ttAjEkoQNafPyCuCAlv/o3HRKrTY*/
/*
 * @Author: xiahui 
 * @PageInfo: 粘贴 
 * @Date: 2019-02-23 09:32:45 
 * @Last Modified by: xiahui
 * @Last Modified time: 2019-07-26 11:37:59
 */
import { FIELDS, COPYPASTEBTNS, PASTECLEARFIELDS, AREA } from '../../constance';
import { rowCopyPasteUtils } from '../../../../../scmpub/scmpub/pub/tool/cardTableTools/rowCopyPasteUtils';
import { RownoUtils } from '../../../../../scmpub/scmpub/pub/tool/cardTableTools';
import { resetShoworderValue } from '../../utils/cardPageUtil';

export default function(props, moduleId, record, index) {
	// 效率优化开启
	props.beforeUpdatePage();

	this.copyRowDatas = this.copyLineDatas[moduleId]; // 需要粘贴的数据
	if (index >= 0 && record) {
		// 操作列 粘贴至此
		rowCopyPasteUtils.pasteRowsToIndex.call(
			this,
			props,
			moduleId,
			index,
			COPYPASTEBTNS[moduleId].initBtns,
			COPYPASTEBTNS[moduleId].pasteBtns,
			PASTECLEARFIELDS[moduleId]
		);
	} else {
		// 粘贴至末行
		rowCopyPasteUtils.pasteRowsToTail.call(
			this,
			props,
			moduleId,
			COPYPASTEBTNS[moduleId].initBtns,
			COPYPASTEBTNS[moduleId].pasteBtns,
			PASTECLEARFIELDS[moduleId]
		);
	}
	this.copyLineDatas[moduleId] = null; // 清空复制数据
	moduleId == AREA.cardTableId ? RownoUtils.setRowNo(props, moduleId, FIELDS.crowno) : '';
	resetShoworderValue(props, moduleId);

	// 效率优化关闭
	props.updatePage(AREA.cardFormId, moduleId);
}

/*f0JfMjUngRu2xmNXuho8gqv/3wzMBrzZNLt+ttAjEkoQNafPyCuCAlv/o3HRKrTY*/